class CreatePosts < ActiveRecord::Migration
  def self.up
    create_table :posts do |t|
      t.string :title, :limit => 100, :null => false
      t.text :description, :null => false
      t.references :user, :null => false
      t.references :forum, :null => false
      t.references :comment
      
      t.timestamps
    end
    add_index(:posts, [:title,:forum_id], :unique =>true, :name => "uk_title_forum")
  end

  def self.down
    drop_table :posts
  end
end
